export const PAGE_CONFIG = {
  showTotal: true, // 是否显示总数
  showJumper: false, // 是否显示跳转
  showPageSize: true, // 是否显示数据条数选择器
  pageSizeOptions: [10, 20, 30, 40, 50]
}

/**
 * 指标开发 table
 */
export const INDEX_DEVELOPE_COLUMNS = [
  {
    title: 'ID',
    dataIndex: 'id',
    width: 80
  },
  {
    title: "指标名称",
    dataIndex: 'cnName',
    slotName: "cnName",
    width: 200
  },
  {
    title: "状态",
    dataIndex: "developStatus",
    slotName: 'developStatus',
    width: 160
  },
  {
    title: "指标类型",
    dataIndex: "metricsTypeName",
    width: 160
  },
  {
    title: "创建时间",
    dataIndex: "createTime",
    width: 180
  },
  {
    title: "负责人",
    dataIndex: "techOwner",
    width: 160
  },
]

/**
 * 加工逻辑
 */

export const PRECESS_COLUMNS = [
  {
    title: '逻辑名称',
    dataIndex: 'logicName',
    slotRenderName: 'logicName',
  },
  // {
  //   title: '状态',
  //   dataIndex: 'status',
  //   slotRenderName: 'status'
  // },
  {
    title: '操作',
    slotRenderName: 'operator'
  }
]

/**
 * 更多
 */
export const MORELIST = [
  {
    label: '变更记录',
    value: 1,
    disabled: false,
  },
  {
    label: '删除',
    value: 2,
    disabled: true
  }
]
/**
 * 指标类型
 */
export const METRICS_TYPE = {
  1: {
    name: '原子指标',
    bg: 'index_grey'
  },
  2: {
    name: '派生指标',
    bg: 'index_2BC'
  },
  3: {
    name: '衍生指标',
    bg: 'index_blue'
  },
  4: {
    name: '中间派生指标',
    bg: 'index_blue'
  }
}

/**
 * 表类型
 */

export const TABLE_FIELD_TYPE = {
  'INTEGER': 'icon-metricsx-intleixing',
  'STRING': 'icon-metricsx-stringleixing',
  'DATETIME': 'icon-metricsx-a-rilicalender',
  'BOOLEAN': 'icon-metricsx-Booleanbuerleixing',
  'DECIMAL': 'icon-metricsx-floatleixing'
}

/**
 * 统计时间
 */

export const COUNT_TIME_OPTION = [
  // {
  //   label: 'hour',
  //   value: 'hour'
  // },
  {
    label: 'date',
    value: 'day'
  },
  {
    label: 'month',
    value: 'month'
  },
  {
    label: 'year',
    value: 'year'
  },
]

/**
 * 选择函数
 */
export const CHOOSE_FUNCTION_OPTION = [
  {
    label: '选择函数',
    value: ''
  },
  {
    label: 'coalesce',
    value: 'coalesce'
  }
]

/**
 * 计算方式
 */
export const FROMULA_MODE_OPTION = [
  {
    label: 'sum',
    value: 'sum',
  },
  {
    label: 'count',
    value: 'count'
  },
  {
    label: 'count_distinct',
    value: 'count_distinct'
  }
]

/**
 * 维度类型
 */

export const DIMENSION_TYPE = [
  {
    label: 'IN',
    value: 'IN'
  },
  {
    label: 'NOT IN',
    value: 'NOT_IN'
  },
  {
    label: 'LIKE',
    value: 'LIKE',
    disabled: true
  },
  {
    label: 'IS NULL',
    value: 'IS_NULL'
  },
  {
    label: 'IS NOT NULL',
    value: 'IS_NOT_NULL'
  }
]

/**
 * 业务限定数字类型的条件
 */

export const BUSINESS_NUMBER_TYPE = [
  {
    label: '=',
    value: 'EQUAL_TO'
  },
  {
    label: '!=',
    value: 'NOT_EQUAL_TO'
  },
  {
    label: '>',
    value: 'MORE_THEN',
  },
  {
    label: '>=',
    value: 'MORE_EQUAL_THAN'
  },
  {
    label: '<',
    value: 'LESS_THAN'
  },
  {
    label: '<=',
    value: 'LESS_EQUAL_THAN'
  },
  {
    label: 'BETWEEN',
    value: 'BETWEEN'
  },
  {
    label: 'IS NULL',
    value: 'IS_NULL'
  },
  {
    label: 'IS NOT NULL',
    value: 'IS_NOT_NULL'
  }
]

/**
 * 业务限定字符串类型的条件
 */

export const BUSINESS_STRING_TYPE = [
  {
    label: '=',
    value: 'EQUAL_TO'
  },
  {
    label: '!=',
    value: 'NOT_EQUAL_TO'
  },
  {
    label: 'IN',
    value: 'IN'
  },
  {
    label: 'NOT IN',
    value: 'NOT_IN'
  },
  {
    label: 'LIKE',
    value: 'LIKE',
  },
  {
    label: 'NOT LIKE',
    value: 'NOT_LIKE',
  },
  {
    label: 'IS NULL',
    value: 'IS_NULL'
  },
  {
    label: 'IS NOT NULL',
    value: 'IS_NOT_NULL'
  }
]

/**
* 业务限定布尔类型
*/

export const BUSINESS_BOOLEAN_TYPE = [
  {
    label: '=',
    value: 'EQUAL_TO'
  },
  {
    label: 'IS NULL',
    value: 'IS_NULL'
  },
  {
    label: 'IS NOT NULL',
    value: 'IS_NOT_NULL'
  }
]

/**
 * 业务限定字符串类型的条件
 */

 export const BUSINESS_DIMINSION_TYPE = [
  {
    label: '=',
    value: 'EQUAL_TO'
  },
  {
    label: '!=',
    value: 'NOT_EQUAL_TO'
  },
  {
    label: 'IN',
    value: 'IN'
  },
  {
    label: 'NOT IN',
    value: 'NOT_IN'
  },
  {
    label: 'IS NULL',
    value: 'IS_NULL'
  },
  {
    label: 'IS NOT NULL',
    value: 'IS_NOT_NULL'
  }
]

//扩展业务范围类型
export interface IBusinessLimit extends defs.BusinessLimitDto {
  compontType: number; 
  isRoot: boolean;
}
